<template>
  <div class="block">

    <el-avatar :size="200" :src="avatarURL"/>
  </div>

  <el-menu
      router="true"
      default-active="2"
      class="el-menu-vertical-demo"
      @open="handleOpen"
      @close="handleClose"
  >
    <el-menu-item index="1" @click="this.$router.push('/')">
        <el-icon><odometer /></el-icon>
        <span>仪表盘</span>
    </el-menu-item>
    <el-sub-menu index="2" >
      <template #title>
        <el-icon><grid /></el-icon>
      <span>常用设置</span>
      </template>
      <el-menu-item-group>
        <el-menu-item index="2-1" @click="this.$router.push('/jiaoshiguanli')">教师管理</el-menu-item>
        <el-menu-item index="2-2" @click="this.$router.push('/xs')">学生管理</el-menu-item>
        <el-menu-item index="2-3" @click="this.$router.push('/gonggaoguanli')">公告管理</el-menu-item>
        <el-menu-item index="2-4" @click="this.$router.push('/xt')">系统配置</el-menu-item>
        <el-menu-item index="2-5" @click="this.$router.push('/pd')">判题服务器</el-menu-item>
      </el-menu-item-group>
    </el-sub-menu>
    <el-sub-menu index="3">
      <template #title>
        <el-icon><aim /></el-icon>
        <span>问题</span>
      </template>
      <el-menu-item-group>
        <el-menu-item index="3-1" @click="this.$router.push('/ql')">问题列表</el-menu-item>
        <el-menu-item index="3-2" @click="this.$router.push('/addquestion')">增加题目</el-menu-item>
        <el-menu-item index="3-3" @click="this.$router.push('/importantquestion')">导入导出题目</el-menu-item>
      </el-menu-item-group>

    </el-sub-menu>
    <el-sub-menu index="4">
      <template #title>
        <el-icon><trophy /></el-icon>
        <span>比赛&练习</span>
      </template>
      <el-menu-item-group>
        <el-menu-item index="4-1" @click="this.$router.push('/race')" >比赛列表</el-menu-item>
        <el-menu-item index="4-2" @click="this.$router.push('/createrace')">创建比赛</el-menu-item>
      </el-menu-item-group>
    </el-sub-menu>
    <el-sub-menu index="5">
      <template #title>
        <el-icon><collection /></el-icon>
        <span>课程</span>

      </template>
      <el-menu-item-group>
        <el-menu-item index="5-1" @click="this.$router.push('/lession')">课程列表</el-menu-item>
        <el-menu-item index="5-2" @click="this.$router.push('/createlession')">创建课程</el-menu-item>
      </el-menu-item-group>
    </el-sub-menu>
  </el-menu>

</template>

<script>
import {Odometer,Grid, Aim,Trophy,Collection} from "@element-plus/icons-vue";

import avatarURL from '../assets/logo.png'
export default {
  name: "RightMenu",
  
  data() {
    return {
      fit: 'contain',
      avatarURL: avatarURL
    }
  },
  methods:{

  },
    components:{
    Odometer,
    Aim,
    Trophy,
    Collection,Grid
  },
}
</script>

<style scoped>

</style>